package cn.miaoyao.miaoyaoms.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.awt.*;
import java.util.List;
import java.util.Map;

/**
 * @Author: shushu
 * @Date: 2023/04/17/17:35
 * @Description:用来进行导航栏的json数据封装。
 */
@Data
@EqualsAndHashCode
public class MenuInfo {
    private static MenuInfo[] data;
    private String title;
    private String icon;
    private String href;
    private String target;
    private List<MenuInfo> child;
    //一级添加
    public static MenuInfo firstAdd(String title,String href,String icon,String target,List<MenuInfo> s){
        MenuInfo menuInfo = new MenuInfo();
        menuInfo.setTarget(target);
        menuInfo.setHref(href);
        menuInfo.setTitle(title);
        menuInfo.setIcon(icon);
        menuInfo.setChild(s);
        return menuInfo;
    }
    //二级导航添加
    public static MenuInfo secondAdd(String title,String href,String icon,String target){
        MenuInfo menuInfo = new MenuInfo();
        menuInfo.setTitle(title);
        menuInfo.setHref(href);
        menuInfo.setIcon(icon);
        menuInfo.setTarget(target);
        return menuInfo;
    }
}
